package com.qfjy.shichengyong.staticproxy;

/**
 * @author:scy
 * @date:2022/9/13 19:19
 * @version:1.0
 */
public class StudentProxy implements Person {

    private Student student;

    public StudentProxy(Person student) {
        if (student.getClass() == Student.class){
            this.student = (Student) student;
        }
    }

    @Override
    public void giveMoney() {
        System.out.print("班长代");
        student.giveMoney();
    }
}
